package com.jrx.anytxn.investor.mapper.ext;

import com.jrx.anytxn.investor.entity.AmLoanMainInvestorInfo;
import com.jrx.anytxn.investor.mapper.base.AmLoanMainInvestorInfoMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 订单信息mapper扩展
 *
 * @author liuyang
 * @date  2020-05-22
 **/
public interface ExtAmLoanMainInvestorInfoMapper extends AmLoanMainInvestorInfoMapper {

    /**
     * 批量插入出资方订单信息
     *
     * @param loanMainInvestorInfos 订单信息
     * @return int 插入的条数
     * @author liuyang
     * @date  2020-05-21
     */
    int batchInsertLoanMain(List<AmLoanMainInvestorInfo> loanMainInvestorInfos);

    /**
     * 根据出资方贷款id，渠道号，客户ID查询订单信息
     *
     * @param investorLoanId 出资方贷款id
     * @param customerId 客户id
     * @param tenantId 租户id
     * @return AmLoanMainInvestorInfo 订单信息
     * @author liuyang
     * @date  2020-05-25
     */
    AmLoanMainInvestorInfo selectByInvestorLoanIdAndCustId(@Param("investorLoanId") String investorLoanId, @Param("customerId") String customerId,
                                          @Param("tenantId") String tenantId);

    /**
     * 获取所有出资方贷款信息
     * @param loanId
     * @param customerId
     * @param tenantId
     * @return
     */
    List<AmLoanMainInvestorInfo> findInvestorLoan(@Param("loanId") String loanId, @Param("customerId") String customerId, @Param("tenantId") String tenantId);


    List<AmLoanMainInvestorInfo> selectByPostingDate(@Param("postingDate") Date payoffDate);

    /**
     * 根据以下条件查询该出资方的订单信息
     * @author fan.yang
     * date: 2020/6/24 0024 下午 14:35
     * @param tenantId 租户ID
     * @param customerId 客户ID
     * @param investorId 出资方ID
     * @return java.util.List<com.jrx.anytxn.investor.entity.AmLoanMainInvestorInfo>
     */
    List<AmLoanMainInvestorInfo> selectByCusIdAndInvestorId(@Param("tenantId") String tenantId,@Param("customerId") String customerId,@Param("investorId") String investorId);

    /**
     * 根据客户号查询
     * @param customerId
     * @param tenantId
     * @return
     */
    List<AmLoanMainInvestorInfo> findByCust(@Param("customerId") String customerId, @Param("tenantId") String tenantId);


}